import { isMobileTerminal } from '@/utils/flexible'
export default {
  category: (state) => state.category.categorys,
  themeType: (state) => state.theme.theme,
  currentCategorys: (state) => state.app.currentCategorys,
  currentCategorysIndex: (state) => {
    return state.category.categorys.findIndex(
      (item) => item.id === state.app.currentCategorys.id
    )
  },
  // 搜索框的文本
  searchText: (state) => state.app.keyword,
  // token
  token: (state) => state.user.token,
  // userInfo
  userInfo: (state) => state.user.userInfo,
  // routerType
  routerType: (state) => {
    if (!isMobileTerminal.value) {
      return 'none'
    } else {
      return state.app.routerType
    }
  }
}
